<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-yellow sidebar-mini">
<section class="content-header">
    <div id="toolbar" class="form-inline" style="margin-top: 20px">
        <a id="btn_notRead" href="javascript:void(0);"
           class="btn btn-success pull-right" style="margin-right: 10px" onclick="editAll()">
            <span class="Bold">保存</span>
        </a>
    </div>
    <h1></h1>
</section>
<section class="content">
    <div class="box-body" style="margin-top: 50px">
        <form id="sheetForm" class="form-horizontal bg-white">
            <input id="id" type="hidden" class="form-control" name="id" th:value="${instDispatchingList.id}" readonly>
            <div class="col-xs-10 col-xs-offset-1">
                <table class="t1" id="hoursTable">
                    <thead>
                    <tr>
                        <td colspan="8">
                            <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -20px">
                            <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                <span style="letter-spacing: 24px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd</span>
                            </div>
                        </td>
                        <td colspan="2" style="width: 9%;font-size: 20px;">安装派工单</td>
                    </tr>
                    <tr>
                        <td style="width: 5%">生产令号</td>
                        <td colspan="1" style="width: 8%;font-size: 14px;">
                            <input id="sheetForm-proCode" type="text" class="form-control" name="proCode"
                                   th:value="${instDispatchingList.proCode}" readonly>
                        </td>
                        <td style="width: 5%">项目名称</td>
                        <td colspan="2" style="width: 12%">
                            <input id="proName" type="text" class="form-control" name="proName"
                                   th:value="${instDispatchingList.proName}" readonly>
                        </td>
                        <td style="width: 5%">订单数量</td>
                        <td colspan="2" style="width: 8%">
                            <input id="proNum" type="number" class="form-control" name="prodNum"
                                   th:value="${instDispatchingList.prodNum}" readonly>
                        </td>
                        <td style="width: 5%">出厂编号</td>
                        <td colspan="2" style="width: 18%">
                            <input type="text" class="form-control" name="factoryNumber"
                                   th:value="${instDispatchingList.factoryNumber}">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5%">需方</td>
                        <td colspan="3" style="width: 15%;font-size: 14px;">
                            <input id="customer" class="form-control" name="customer"
                                   th:value="${instDispatchingList.customer}" readonly>
                        </td>
                        <td style="width: 8%">安装地点</td>
                        <td colspan="3" style="width: 12%">
                            <input id="installPlace" type="text" class="form-control" name="installPlace"
                                   th:value="${instDispatchingList.installPlace}">
                        </td>
                        <td style="width: 8%">安装数量</td>
                        <td colspan="1" style="width: 8%">
                            <input id="installNum" type="number" class="form-control" name="installNum"
                                   th:value="${instDispatchingList.installNum}">
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 10%">项目负责人及联系方式</td>
                        <td colspan="4" style="width: 15%;font-size: 14px;">
                            <input id="projectLeader" class="form-control" name="projectLeader"
                                   th:value="${instDispatchingList.projectLeader}">
                        </td>
                        <td style="width: 10%">设计负责人及联系方式</td>
                        <td colspan="4" style="width: 12%">
                            <input id="designLeader" type="text" class="form-control" name="designLeader"
                                   th:value="${instDispatchingList.designLeader}">
                        </td>
                        <!--<td style="width: 8%">生产订单编号</td>-->
                        <!--<td colspan="3" style="width: 12%">-->
                        <!--<input id="prodNo" type="text" class="form-control" name="prodNo" th:value="${instDispatchingList.designLeader}" >-->
                        <!--</td>-->
                    </tr>
                    <tr>
                        <td style="width: 10%">安装需求</td>
                        <td colspan="9" style="width: 80%;font-size: 14px;">
                            <input id="installationRequirements" class="form-control" name="installationRequirements"
                                   th:value="${instDispatchingList.installationRequirements}">
                        </td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td style="width: 6%">类型</td>
                        <td colspan="2" style="width: 15%">安装负责人</td>
                        <td colspan="2" style="width: 15%">要求完成日期</td>
                        <td colspan="5" style="width: 20%">备注</td>
                    </tr>
                    <!--<thead>-->
                    <!--<tr>-->
                    <!--<td style="width: 10%">类型</td>-->
                    <!--<td style="width: 23%">安装负责人</td>-->
                    <!--<td style="width: 16%">要求完成日期</td>-->
                    <!--<td style="width: 10%">是否调试</td>-->
                    <!--<td style="width: 25%">备注</td>-->
                    <!--</tr>-->
                    <!--</thead>-->
                    <tbody>
                    <tr th:each="instDispatchingDetailsJx : ${instDispatchingDetailsJx}" >
                        <td colspan="1" style="width: 6%">
                            <input type="text" class="form-control" name="special" autocomplete="off"
                                   th:value="${instDispatchingDetailsJx.special}" readonly>
                            <input name="idd" type="text" th:value="${instDispatchingDetailsJx.id}" hidden/>
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control" name="installPrincipal" autocomplete="off"
                                   th:value="${instDispatchingDetailsJx.installPrincipal}">
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control datepicker" name="installTime"
                                   th:value="${#dates.format(instDispatchingDetailsJx.installTime, 'yyyy-MM-dd')}"
                                   style="width: 100%;"/>
                        </td>

                        <td colspan="5" style="width: 20%">
                            <input type="text" class="form-control" name="installRemark" autocomplete="off"
                                   th:value="${instDispatchingDetailsJx.installRemark}">
                        </td>
                    </tr>
                    <tr  th:each="instDispatchingDetailsLt : ${instDispatchingDetailsLt}" >
                        <td colspan="1" style="width: 6%">
                            <input type="text" class="form-control" name="special" autocomplete="off"
                                   th:value="${instDispatchingDetailsLt.special}" readonly>
                            <input name="idd" type="text" th:value="${instDispatchingDetailsLt.id}" hidden/>
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control" name="installPrincipal" autocomplete="off"
                                   th:value="${instDispatchingDetailsLt.installPrincipal}">
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control datepicker" name="installTime"
                                   th:value="${#dates.format(instDispatchingDetailsLt.installTime, 'yyyy-MM-dd')}"
                                   style="width: 100%;"/>
                        </td>

                        <td colspan="5" style="width: 20%">
                            <input type="text" class="form-control" name="installRemark" autocomplete="off"
                                   th:value="${instDispatchingDetailsLt.installRemark}">
                        </td>
                    </tr>
                    <tr  th:each="instDispatchingDetailsZdh : ${instDispatchingDetailsZdh}" >
                        <td colspan="1" style="width: 6%">
                            <input type="text" class="form-control" name="special" autocomplete="off"
                                   th:value="${instDispatchingDetailsZdh.special}" readonly>
                            <input name="idd" type="text" th:value="${instDispatchingDetailsZdh.id}" hidden/>
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control" name="installPrincipal" autocomplete="off"
                                   th:value="${instDispatchingDetailsZdh.installPrincipal}">
                        </td>
                        <td colspan="2" style="width: 15%">
                            <input type="text" class="form-control datepicker" name="installTime"
                                   th:value="${#dates.format(instDispatchingDetailsZdh.installTime, 'yyyy-MM-dd')}"
                                   style="width: 100%;"/>
                        </td>
                        <td colspan="5" style="width: 20%">
                            <input type="text" class="form-control" name="installRemark" autocomplete="off"
                                   th:value="${instDispatchingDetailsZdh.installRemark}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    /** 保存 */
    function editAll() {
        debugger
        let res = js.vd({
            id: 'sheetForm',
            notEmpty: ['prodNo', 'proCode', 'installNum', 'designLeader', 'installationRequirements', 'installPlace'
                , 'projectLeader', 'factoryNumber', 'installPrincipal', 'installTime', 'isDebugging']
        })
        if (!res) {
            return;
        }
        var url = ctx + "create/dispatching/editDispatching";
        js.validSubmit({
            formId: "sheetForm",
            url: url,
            data: new FormData($("#sheetForm")[0]),
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    js.modal.success(result.msg);
                    location.href= ctx +"create/dispatching/submit";
                } else {
                    js.modal.warning(result.msg);
                }
            }
        });
    }

    $(function () {
    });
</script>
</body>
</html>